﻿Public MustInherit Class Controller
    Implements FormListener

    Public Sub hide()
        getFormAdapter().hide()
    End Sub

    Public Overridable Sub show()
        getFormAdapter().show()
    End Sub

    Public Sub setEnabled(ByRef enabled As Boolean)
        getFormAdapter().setEnabled(enabled)
    End Sub

    Protected Overridable Sub init()
        With getFormAdapter()
            .hide()
        End With
    End Sub

    Protected MustOverride Function getFormAdapter() As FormAdapter(Of Form, FormListener)

    Public Overridable Sub onClose() Implements FormListener.onClose
        'force Closing
        Application.ExitThread()
    End Sub

End Class
